<?php
require_once 'lib/mtd/pool.php';
require_once 'lib/mtd/ipc.php';

class Thread extends IPC
{
	public static function main()
	{
		echo 'Hello world';
		
		$threads = new Thread;
		
		$threads->spawn(array($threads, 'new_thread'), array('My first thread'));
		$threads->spawn(array($threads, 'new_thread'), array('My second thread'));
	}
	
	public function new_thread($text)
	{
		echo ". Yes, its world, and hello <{$text}>!";
	}
}

new Pool;